#ifndef _SHMMEMORY_H_
#define _SHMMEMORY_H_

#include "netfwd.h"

#pragma once

class ShmMemory
{
public:
    typedef int32_t     key_t;
    typedef int32_t     chkid_t;

    explicit ShmMemory( bool verify = true );

    ~ShmMemory() throw();

    void * init_acquire( key_t shmKey, chkid_t shmChkId, int32_t alloc_size, int32_t & first_time );

    void * base_addr() const;

    int32_t pool_size() const;

private:
    struct SHM_TB
    {
        key_t       m_shmkey;
        int32_t     m_shmid;
        chkid_t     m_id;
    };

    bool        m_verify;
    SHM_TB *    m_shmtb;
    int32_t     m_pool_size;
    void *      m_baseaddr;
};

#endif // _SHMMEMORY_H_

